﻿<%@ Page Title="" Language="C#" MasterPageFile="~/manager/page/ManagerMasterPage.Master" AutoEventWireup="true" CodeBehind="article2.aspx.cs" Inherits="Com.Web.coffinegurunaru.manager.board.article2" %>
<%@ Register TagPrefix="UC" TagName="BoardMenu" Src="~/manager/board/boardmenu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phContent" runat="server">

<hr />
<br />
<table>
<tr>
	<td valign="top">
        <UC:BoardMenu id="boardMenu" runat="server" />
	</td>
	<td style="width:20px;"></td>
	<td valign="top">
        <table width="100%">
		<tr>
			<td style="text-align:center;" valign="top">
				<div id="m_List"></div>
				<br />
				<div id="m_Pager"></div>			
			</td>
			<td style="width:10px">&nbsp;
			</td>
			<td valign="top">
				<div id="m_Info"></div>
			</td>
		</tr>
		</table>
	</td>
</tr>
</table>


<script language="javascript" type="text/javascript">
(function($) {
	$.Article2 = {};
	
	$.Article2 = {
		BoardSN : <%=BoardSN %>,

		Init : function() {
			$("#m_Pager").pager({
				pageSize : 20,
				useCallback : true,
				currentPageNo : 1,
				callback:function(pageNo) {
					$.Article2.GetList();
				}
			});

			$.Article2.GetList();
		},
		
		GetList : function() {
			$("#m_List").ajaxNet(
			"/manager/board/boardMethod.aspx?_vb=GetListArticle2" ,
			{
				"BoardSN" : $.Article2.BoardSN
			,	"PageNo" : $("#m_Pager").pager("option", "currentPageNo")
			,	"PageSize" : $("#m_Pager").pager("option", "pageSize")
			,	"Title_Search" : "" 
			}, function(results, context)
			{
				$("#m_List").html( results[ 0 ] );
				$("#m_List").find("input.m_btnInfo, a.m_btnInfo").click(function() {
					var $tr = $(this).closest("tr");
					$tr.parent().find("tr").css({"background-color":"#ffffff"});
					$tr.css({"background-color":"#efefef"});
					var data = $tr.tagdata();
					$.Article2.GetInfo(data.ArticleSN);
				});
				$("#m_List").find("input.m_btnRemove").click(function() {
					var $tr = $(this).closest("tr");
					var data = $tr.tagdata();
					$.Article2.Remove(data.ArticleSN);
				});
				$("#m_Pager").pager("update", results[1]);
			});
		},
		
		GetInfo : function( ArticleSN ) {
			$("#m_Info").ajaxNet(
			"/manager/board/boardMethod.aspx?_vb=GetInfoArticle2" ,
			{
				"ArticleSN" : ArticleSN
			}, function(results, context)
			{
				$("#m_Info").html( results );
			});
		},
		
		Remove : function(ArticleSN, isEmpty) {
			if ( confirm("정말로 삭제하시겠습니까?") ) {
				$("#m_Info").ajaxNet(
				"/manager/board/boardMethod.aspx?_vb=RemoveArticle" ,
				{
					"ArticleSN" : ArticleSN
				}, function(results, context)
				{
					$.Article2.GetList();
					$("#m_Info").empty();
				});
			}
		}
	}
	
	$(function() {
		$.Article2.Init();
	});
})(jQuery);
</script>


</asp:Content>
